package com.lsl.factory_method.example2.method;


import com.lsl.factory_method.example2.method.racialtype.Blacksmith;
import com.lsl.factory_method.example2.method.racialtype.ElfBlacksmith;
import com.lsl.factory_method.example2.method.racialtype.OrcBlacksmith;
import com.lsl.factory_method.example2.method.weapontype.Weapon;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author Zed
 * @description
 * @date 2023/1/8 15:02
 */
@Slf4j
public class App {
    private static final String MANUFACTURED = "{} manufactured {}";
    private static final Logger logger = LoggerFactory.getLogger(App.class);

    /**
     * Program entry point.
     * @param args command line args
     */
    public static void main(String[] args) {
        Blacksmith blacksmith;
        blacksmith = new OrcBlacksmith();
        Weapon weapon = blacksmith.manufactureWeapon(WeaponType.SPEAR);
        logger.info(MANUFACTURED, blacksmith, weapon);

        weapon = blacksmith.manufactureWeapon(WeaponType.AXE);
        logger.info(MANUFACTURED, blacksmith, weapon);

        weapon = blacksmith.manufactureWeapon(WeaponType.SHORT_SWORD);
        logger.info(MANUFACTURED, blacksmith, weapon);

        logger.info("-----------------------------------------------");

        blacksmith = new ElfBlacksmith();
        weapon = blacksmith.manufactureWeapon(WeaponType.SPEAR);
        logger.info(MANUFACTURED, blacksmith, weapon);

        weapon = blacksmith.manufactureWeapon(WeaponType.AXE);
        logger.info(MANUFACTURED, blacksmith, weapon);

        weapon = blacksmith.manufactureWeapon(WeaponType.SHORT_SWORD);
        logger.info(MANUFACTURED, blacksmith, weapon);
    }
}
